import { defineStore } from "pinia";
import { ref, reactive } from "vue";

//定义Answer接口 respond respondDesc都定义为可选参数
export interface Answer {
    questionId: number, //问题ID
    respond?: string,    //选择题答案
    respondDesc?: string //代码题答案
}

//存储答案的store
export const useAnswer = defineStore("answer", () => {
    //存储答案的对象
    let answers = reactive({
        answersArray: [] as Answer[]
    })
    
    return { answers }
})